//
//  DayViewIconView.swift
//  YOKO
//
//  Created by Zoe_G on 16/5/24.
//  Copyright © 2016年 15Tec. All rights reserved.
//

import UIKit

class DayViewIconView: UIView {
    
    var iconType: CircleIconType = CircleIconType.IconNone
    var eventColor: Int = 0 

    override func drawRect(rect: CGRect) {
        
        self.layer.shadowOffset = CGSizeMake(0, 1)
        self.layer.shadowColor = UIColor.lightGrayColor().CGColor
        self.layer.shadowRadius = 2.0
        self.layer.shadowOpacity = 0.4
        
        switch iconType {
        case .StrokeWithLine:
            // 整点时间
            DrawUtil.drawCircle(CGPointMake(self.frame.width / 2, self.frame.height / 2), radius: self.frame.width / 2 - 2.0, circleType: CircleIconType.StrokeWithLine, circleColor: YOKOColor.TypeColors[eventColor], linewidth: 2.0)
            
        case .FillWithColor:
            // 全天事件，跨全天事件
            DrawUtil.drawCircle(CGPointMake(self.frame.width / 2, self.frame.height / 2), radius: self.frame.width / 2 - 2.0, circleType: CircleIconType.FillWithColor, circleColor: YOKOColor.TypeColors[eventColor], linewidth: 2.0)
            
        case .HalfFillWithColor:
            // 时间段事件
            DrawUtil.drawCircle(CGPointMake(self.frame.width / 2, self.frame.height / 2), radius: self.frame.width / 2 - 2.0, circleType: CircleIconType.HalfFillWithColor, circleColor: YOKOColor.TypeColors[eventColor], linewidth: 2.0)
            
        default:
            break
            
        }
    }

}
